<template>
  <div>
    <h1>vue数据变视图不会改变-----$set</h1>
    <h1>{{ obj.name }}--{{obj.sex}}</h1>
    <button @click="fun()">$SET</button>
  </div>
</template>

<script>
export default {
  data() {
    return {
      obj: {
        name: "DaHong",
      },
    }
  },
    methods:{
        fun(){
            this.$set(this.obj,"sex","男")
        }
    }
  
};
</script>

<style>
</style>